<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>admin</title>
<script language="javascript" src="/js/jquery.js"></script>
<script language="javascript">

$(function(){
	$("#submitBut").click(function(){
		var err=0;
		for(var k=1;k<=5;k++){
			if (!$.trim($('#s' + k).val())) {
				alert('請輸入投票走勢！');
				$('#s' + k).focus();
				return false;
			}
		}
	
		if(!err)$("#form1").submit();
	});
})
</script>
<style>
li{list-style-type:none;}
</style>
</head>

<body>
  <table width="800" border="0" cellpadding="5" cellspacing="1" bgcolor="#979797">
    <tr>
      <td height="40" colspan="2" bgcolor="#FFFFFF"><strong>輸入投票走勢：</strong></td>
    </tr>
	<form id="form1" method="post" action="?action=admin_result_submit">
	{#foreach from=$phase_info key=k item=v#}
	<tr>
      <td height="25" bgcolor="#FFFFFF">{#$k#}.{#$v.name#}</td>
      <td bgcolor="#FFFFFF">
		{#if !empty($v.vote)#}
		<ul style="height:100px;overflow:auto;">
			{#foreach from=$v.vote key=k3 item=v3#}
				<li><strong>{#htmlencode($v3.title)#}</strong></li>
				{#foreach from=$v3.item key=k4 item=v4#}
					<li>&nbsp;&nbsp;<strong>{#$v4.id#}</strong>&nbsp;{#htmlencode($v4.title)#}</li>
				{#/foreach#}
			{#/foreach#}
		</ul>
		<h3>請按次序輸入產品id，以,分隔開，如1,2,3</h3>
		<input type="text" name="s{#$k#}" id="s{#$k#}" value="{#implode(',', $vote_result[$k])#}" />
		{#/if#}
      </td>
    </tr>
	{#/foreach#}
    <tr>
      <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><input type="button" name="button" id="submitBut" value="提交" /></td>
    </tr>
	</form>
    <tr>
		<td height="25" bgcolor="#FFFFFF">導出會員</td>
		<form id="form2" method="post" action="?action=member_report" target="_blank">
			<td bgcolor="#FFFFFF">
				會員類型：<select name="member_type"><option value="3">All</option><option value="0">普通會員</option><option value="1">試用會員</option><option value="5">體驗團會員</option></select>
				投票類型：<select name="vote_type"><option value="0">All</option><option value="1">護膚產品</option><option value="2">化妝產品</option><option value="3">頭髮產品</option><option value="4">個人護理產品</option><option value="5">台灣美妝產品</option></select>
				<input type="submit" value="提交" />
			</td>
		</form>
    </tr>
	<tr>
		<td height="25" bgcolor="#FFFFFF">導出投票數據</td>
		<form id="form2" method="post" action="?action=item_report" target="_blank">
			<td bgcolor="#FFFFFF">
				投票類型：<select name="vote_type"><option value="0">All</option><option value="1">護膚產品</option><option value="2">化妝產品</option><option value="3">頭髮產品</option><option value="4">個人護理產品</option><option value="5">台灣美妝產品</option></select>
				<input type="submit" value="提交" />
			</td>
		</form>
    </tr>
  </table>
</body>
</html>
